$(function(){
	
	
	
});



//条件查找
function searcterm(id){
	
	var $modal = $('#diaModal');
	
	var model;
	
	if(id==1){
		$("#trem_content").empty();  //清空
		$("#term_title").text('选择类别');  //设置标题
		
		model = '<ul class="am-nav">';
		model += '<li><a href="#" onclick="javascript:sel_category(\'\');">全部</a></li>';
		model += '<li><a href="#" onclick="javascript:sel_category(\'水电\');">水电</a></li>';
		model += '<li><a href="#" onclick="javascript:sel_category(\'燃气\');">燃气</a></li>';
		model += '<li><a href="#" onclick="javascript:sel_category(\'装修\');">装修</a></li>';
		model += '<li><a href="#" onclick="javascript:sel_category(\'清洁\');">清洁</a></li>';
		model += '<li><a href="#" onclick="javascript:sel_category(\'家政\');">家政</a></li>';
		model += '<li><a href="#" onclick="javascript:sel_category(\'家居\');">家居</a></li>';
		model += '</ul>';
		
		$("#trem_content").append(model);  //填充内容
	
		
	}
	
	

	
	if(id==2){
		var sort=$("#sort").val();
		var category=$("#category").val();
		if(sort=="desc"){
			sort="asc";
		}else{
			sort="desc";
		}
		
		
	    location.href="/appointments?category="+category+"&sort="+sort;
		
		
		return;
		
	}
	
	
	
	
	 $modal.modal('toggle');  // 显示窗口
	
}


//选择类别
function sel_category(category){	
	
	$('#termModal').modal('close');  // 关闭窗口
	
	var sort=$("#sort").val();
	
	location.href="/appointments?category="+category+"&sort="+sort;
	
	
	
}


